package com.ensah.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.boudaa.dao.exceptions.EntityNotFoundException;
import com.ensah.dao.EtudiantDao;
import com.ensah.dao.impl.RoleDaoImpl;
import com.ensah.metier.bo.Absence;
import com.ensah.metier.bo.Attestation;
import com.ensah.metier.bo.Classe;
import com.ensah.metier.bo.Etudiant;
import com.ensah.metier.bo.Matiere;
import com.ensah.metier.bo.Role;
import com.ensah.service.ClasseService;
import com.ensah.service.EtudiantService;
import com.ensah.service.RoleService;

public class EtudiantServiceImpl implements EtudiantService{

	
	private EtudiantDao etdao;
	
	

	public EtudiantDao getEtdao() {
		return etdao;
	}

	public void setEtdao(EtudiantDao etdao) {
		this.etdao = etdao;
	}


	public Etudiant getEtudiantByCne(String cne) throws EntityNotFoundException {
		
		return etdao.findEtudiantByCne(cne);
	}

	
	public List<Etudiant> getEtudiantByNom(String nom) throws EntityNotFoundException {
		
		return etdao.findEtudiantByNom(nom);
	}

	
	public Etudiant getEtudiantById(Long id) throws EntityNotFoundException {
		
		return etdao.findById(id);
	}


	public Etudiant saveEtudiant(Etudiant etd) {
     	 Etudiant et=etdao.create(etd);
		 return et;
		
	}

	
	public void supprimerEtudiant(Long idEtd) {

		etdao.delete(idEtd);
	}

	
	public void modifierEtudiant(Etudiant etd) {

		etdao.update(etd);
	}


}
